package com.brozha.ans_sys.controller;

import com.brozha.ans_sys.service.OssService;
import com.brozha.ans_sys.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author brozha
 * @since 2021/4/11
 */
@RestController
@RequestMapping("/api/oss")
@Api(tags = "文件上传api")
@CrossOrigin
public class OssController {

    @Autowired
    OssService ossService;

    @ApiOperation("头像上传")
    @PostMapping("/uploatAvatar")
    public Result uploadFileAvatar(MultipartFile file){
        return ossService.uploadFileAvatar(file);
    }
}
